\hypertarget{class_q_c_p_color_gradient}{}\section{Q\+C\+P\+Color\+Gradient Class Reference}
\label{class_q_c_p_color_gradient}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}


Defines a color gradient for use with e.\+g. \mbox{\hyperlink{class_q_c_p_color_map}{Q\+C\+P\+Color\+Map}}.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1}{Color\+Interpolation}} \{ \mbox{\hyperlink{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1a5e30f725c9cfe93999e268a9f92afbe7}{ci\+R\+GB}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1af14ae62fcae11ecc07234eeaec5856cb}{ci\+H\+SV}}
 \}
\item 
enum \mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}{Gradient\+Preset}} \{ \newline
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072add11ae369a86f3b1b6205ec72e5021fb}{gp\+Grayscale}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a4f42e534cf6cff5a29a5388094d099b5}{gp\+Hot}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557}{gp\+Cold}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a1bb89351b6def7d220973443fe059c62}{gp\+Night}}, 
\newline
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a9e72663bf6b94b65945f7843f24e0721}{gp\+Candy}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a382f0b07cec1a59d8a533438aea815d2}{gp\+Geography}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a4297f4f9e212a819cd65e8e34567182b}{gp\+Ion}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072af1676b129f9f458ace453f280c731cf7}{gp\+Thermal}}, 
\newline
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072ab7414ce4e36dc3e82e0132a7f0f41b52}{gp\+Polar}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072ad63adc100ef46f6b4a8a6deacec4642f}{gp\+Spectrum}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a5f8a9e67b64c17ddfe4f069fe2b9fb02}{gp\+Jet}}, 
\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130}{gp\+Hues}}
 \}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_q_c_p_color_gradient_a546e44df5fa1846400a582c041361c85}{Q\+C\+P\+Color\+Gradient}} (\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}{Gradient\+Preset}} preset=\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557}{gp\+Cold}})
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_a7f3478c33c59aa3c03b9ea1f809877fa}\label{class_q_c_p_color_gradient_a7f3478c33c59aa3c03b9ea1f809877fa}} 
bool {\bfseries operator==} (const \mbox{\hyperlink{class_q_c_p_color_gradient}{Q\+C\+P\+Color\+Gradient}} \&other) const
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_ad26a10e3beaef4fc6f2553d1a9756087}\label{class_q_c_p_color_gradient_ad26a10e3beaef4fc6f2553d1a9756087}} 
bool {\bfseries operator!=} (const \mbox{\hyperlink{class_q_c_p_color_gradient}{Q\+C\+P\+Color\+Gradient}} \&other) const
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_ac4b9d7034fc3b6c76318b05075367090}\label{class_q_c_p_color_gradient_ac4b9d7034fc3b6c76318b05075367090}} 
int {\bfseries level\+Count} () const
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_aaab19729e921682401044ac8e518ff02}\label{class_q_c_p_color_gradient_aaab19729e921682401044ac8e518ff02}} 
Q\+Map$<$ double, Q\+Color $>$ {\bfseries color\+Stops} () const
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_abad5002858db8cf75ecb045200881de6}\label{class_q_c_p_color_gradient_abad5002858db8cf75ecb045200881de6}} 
\mbox{\hyperlink{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1}{Color\+Interpolation}} {\bfseries color\+Interpolation} () const
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_a22a1d2b17f203caf0dcec833507fb9e0}\label{class_q_c_p_color_gradient_a22a1d2b17f203caf0dcec833507fb9e0}} 
bool {\bfseries periodic} () const
\item 
void \mbox{\hyperlink{class_q_c_p_color_gradient_a18da587eb4f7fc788ea28ba15b6a12de}{set\+Level\+Count}} (int n)
\item 
void \mbox{\hyperlink{class_q_c_p_color_gradient_a724e828aa6f0ba5011a9392477c35d3a}{set\+Color\+Stops}} (const Q\+Map$<$ double, Q\+Color $>$ \&color\+Stops)
\item 
void \mbox{\hyperlink{class_q_c_p_color_gradient_a3b48be5e78079db1bb2a1188a4c3390e}{set\+Color\+Stop\+At}} (double position, const Q\+Color \&color)
\item 
void \mbox{\hyperlink{class_q_c_p_color_gradient_aa13fda86406e1d896a465a409ae63b38}{set\+Color\+Interpolation}} (\mbox{\hyperlink{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1}{Color\+Interpolation}} interpolation)
\item 
void \mbox{\hyperlink{class_q_c_p_color_gradient_a39d6448155fc00a219f239220d14bb39}{set\+Periodic}} (bool enabled)
\item 
void \mbox{\hyperlink{class_q_c_p_color_gradient_aaf423ceb943e177b0ed2c48c811d83dc}{colorize}} (const double $\ast$data, const \mbox{\hyperlink{class_q_c_p_range}{Q\+C\+P\+Range}} \&range, Q\+Rgb $\ast$scan\+Line, int n, int data\+Index\+Factor=1, bool logarithmic=false)
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_a0599545c859268b025d2060dea741cea}\label{class_q_c_p_color_gradient_a0599545c859268b025d2060dea741cea}} 
Q\+Rgb {\bfseries color} (double position, const \mbox{\hyperlink{class_q_c_p_range}{Q\+C\+P\+Range}} \&range, bool logarithmic=false)
\item 
void \mbox{\hyperlink{class_q_c_p_color_gradient_aa0aeec1528241728b9671bf8e60b1622}{load\+Preset}} (\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}{Gradient\+Preset}} preset)
\item 
void \mbox{\hyperlink{class_q_c_p_color_gradient_a939213e85f0d1279519d555c5fcfb6ad}{clear\+Color\+Stops}} ()
\item 
\mbox{\hyperlink{class_q_c_p_color_gradient}{Q\+C\+P\+Color\+Gradient}} \mbox{\hyperlink{class_q_c_p_color_gradient_a9f72f501de429829ec446333316decda}{inverted}} () const
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_a353f15ab3ab586eebf1f6b58c3e2707b}\label{class_q_c_p_color_gradient_a353f15ab3ab586eebf1f6b58c3e2707b}} 
void {\bfseries update\+Color\+Buffer} ()
\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_a98fb68e359904b2c991fcae3e38a211a}\label{class_q_c_p_color_gradient_a98fb68e359904b2c991fcae3e38a211a}} 
int {\bfseries m\+Level\+Count}
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_a9e11a2b0974ef289d12c324822bc3a3e}\label{class_q_c_p_color_gradient_a9e11a2b0974ef289d12c324822bc3a3e}} 
Q\+Map$<$ double, Q\+Color $>$ {\bfseries m\+Color\+Stops}
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_a028cef73d863800a9ee93ffd641cce01}\label{class_q_c_p_color_gradient_a028cef73d863800a9ee93ffd641cce01}} 
\mbox{\hyperlink{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1}{Color\+Interpolation}} {\bfseries m\+Color\+Interpolation}
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_a4b07deeb20ca1ee2d5ea7e01bf0420af}\label{class_q_c_p_color_gradient_a4b07deeb20ca1ee2d5ea7e01bf0420af}} 
bool {\bfseries m\+Periodic}
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_af8b5f0739faa5f8295154d47ce38ecff}\label{class_q_c_p_color_gradient_af8b5f0739faa5f8295154d47ce38ecff}} 
Q\+Vector$<$ Q\+Rgb $>$ {\bfseries m\+Color\+Buffer}
\item 
\mbox{\Hypertarget{class_q_c_p_color_gradient_abacf55e11f67d6722a687af1bb2687bd}\label{class_q_c_p_color_gradient_abacf55e11f67d6722a687af1bb2687bd}} 
bool {\bfseries m\+Color\+Buffer\+Invalidated}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Defines a color gradient for use with e.\+g. \mbox{\hyperlink{class_q_c_p_color_map}{Q\+C\+P\+Color\+Map}}. 

This class describes a color gradient which can be used to encode data with color. For example, \mbox{\hyperlink{class_q_c_p_color_map}{Q\+C\+P\+Color\+Map}} and \mbox{\hyperlink{class_q_c_p_color_scale}{Q\+C\+P\+Color\+Scale}} have \mbox{\hyperlink{class_q_c_p_color_map_a7313c78360471cead3576341a2c50377}{set\+Gradient}} methods which take an instance of this class. Colors are set with \mbox{\hyperlink{class_q_c_p_color_gradient_a3b48be5e78079db1bb2a1188a4c3390e}{set\+Color\+Stop\+At(double position, const Q\+Color \&color)}} with a {\itshape position} from 0 to 1. In between these defined color positions, the color will be interpolated linearly either in R\+GB or H\+SV space, see \mbox{\hyperlink{class_q_c_p_color_gradient_aa13fda86406e1d896a465a409ae63b38}{set\+Color\+Interpolation}}.

Alternatively, load one of the preset color gradients shown in the image below, with \mbox{\hyperlink{class_q_c_p_color_gradient_aa0aeec1528241728b9671bf8e60b1622}{load\+Preset}}, or by directly specifying the preset in the constructor.



The fact that the \mbox{\hyperlink{class_q_c_p_color_gradient_a546e44df5fa1846400a582c041361c85}{Q\+C\+P\+Color\+Gradient(\+Gradient\+Preset preset)}} constructor allows directly converting a \mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}{Gradient\+Preset}} to a \mbox{\hyperlink{class_q_c_p_color_gradient}{Q\+C\+P\+Color\+Gradient}}, you can also directly pass \mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}{Gradient\+Preset}} to all the {\itshape set\+Gradient} methods, e.\+g.\+: 
\begin{DoxyCodeInclude}
\end{DoxyCodeInclude}
 The total number of levels used in the gradient can be set with \mbox{\hyperlink{class_q_c_p_color_gradient_a18da587eb4f7fc788ea28ba15b6a12de}{set\+Level\+Count}}. Whether the color gradient shall be applied periodically (wrapping around) to data values that lie outside the data range specified on the plottable instance can be controlled with \mbox{\hyperlink{class_q_c_p_color_gradient_a39d6448155fc00a219f239220d14bb39}{set\+Periodic}}. 

\subsection{Member Enumeration Documentation}
\mbox{\Hypertarget{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1}\label{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!Color\+Interpolation@{Color\+Interpolation}}
\index{Color\+Interpolation@{Color\+Interpolation}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{Color\+Interpolation}{ColorInterpolation}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1}{Q\+C\+P\+Color\+Gradient\+::\+Color\+Interpolation}}}

Defines the color spaces in which color interpolation between gradient stops can be performed.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_color_gradient_aa13fda86406e1d896a465a409ae63b38}{set\+Color\+Interpolation}} 
\end{DoxySeeAlso}
\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{ci\+R\+GB@{ci\+R\+GB}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!ci\+R\+GB@{ci\+R\+GB}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1a5e30f725c9cfe93999e268a9f92afbe7}\label{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1a5e30f725c9cfe93999e268a9f92afbe7}} 
ci\+R\+GB&Color channels red, green and blue are linearly interpolated. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{ci\+H\+SV@{ci\+H\+SV}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!ci\+H\+SV@{ci\+H\+SV}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1af14ae62fcae11ecc07234eeaec5856cb}\label{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1af14ae62fcae11ecc07234eeaec5856cb}} 
ci\+H\+SV&Color channels hue, saturation and value are linearly interpolated (The hue is interpolated over the shortest angle distance) \\
\hline

\end{DoxyEnumFields}
\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!Gradient\+Preset@{Gradient\+Preset}}
\index{Gradient\+Preset@{Gradient\+Preset}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{Gradient\+Preset}{GradientPreset}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}{Q\+C\+P\+Color\+Gradient\+::\+Gradient\+Preset}}}

Defines the available presets that can be loaded with \mbox{\hyperlink{class_q_c_p_color_gradient_aa0aeec1528241728b9671bf8e60b1622}{load\+Preset}}. See the documentation there for an image of the presets. \begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Grayscale@{gp\+Grayscale}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Grayscale@{gp\+Grayscale}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072add11ae369a86f3b1b6205ec72e5021fb}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072add11ae369a86f3b1b6205ec72e5021fb}} 
gp\+Grayscale&Continuous lightness from black to white (suited for non-\/biased data representation) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Hot@{gp\+Hot}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Hot@{gp\+Hot}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a4f42e534cf6cff5a29a5388094d099b5}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a4f42e534cf6cff5a29a5388094d099b5}} 
gp\+Hot&Continuous lightness from black over firey colors to white (suited for non-\/biased data representation) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Cold@{gp\+Cold}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Cold@{gp\+Cold}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557}} 
gp\+Cold&Continuous lightness from black over icey colors to white (suited for non-\/biased data representation) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Night@{gp\+Night}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Night@{gp\+Night}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a1bb89351b6def7d220973443fe059c62}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a1bb89351b6def7d220973443fe059c62}} 
gp\+Night&Continuous lightness from black over weak blueish colors to white (suited for non-\/biased data representation) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Candy@{gp\+Candy}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Candy@{gp\+Candy}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a9e72663bf6b94b65945f7843f24e0721}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a9e72663bf6b94b65945f7843f24e0721}} 
gp\+Candy&Blue over pink to white. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Geography@{gp\+Geography}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Geography@{gp\+Geography}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a382f0b07cec1a59d8a533438aea815d2}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a382f0b07cec1a59d8a533438aea815d2}} 
gp\+Geography&Colors suitable to represent different elevations on geographical maps. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Ion@{gp\+Ion}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Ion@{gp\+Ion}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a4297f4f9e212a819cd65e8e34567182b}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a4297f4f9e212a819cd65e8e34567182b}} 
gp\+Ion&Half hue spectrum from black over purple to blue and finally green (creates banding illusion but allows more precise magnitude estimates) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Thermal@{gp\+Thermal}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Thermal@{gp\+Thermal}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072af1676b129f9f458ace453f280c731cf7}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072af1676b129f9f458ace453f280c731cf7}} 
gp\+Thermal&Colors suitable for thermal imaging, ranging from dark blue over purple to orange, yellow and white. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Polar@{gp\+Polar}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Polar@{gp\+Polar}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072ab7414ce4e36dc3e82e0132a7f0f41b52}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072ab7414ce4e36dc3e82e0132a7f0f41b52}} 
gp\+Polar&Colors suitable to emphasize polarity around the center, with blue for negative, black in the middle and red for positive values. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Spectrum@{gp\+Spectrum}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Spectrum@{gp\+Spectrum}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072ad63adc100ef46f6b4a8a6deacec4642f}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072ad63adc100ef46f6b4a8a6deacec4642f}} 
gp\+Spectrum&An approximation of the visible light spectrum (creates banding illusion but allows more precise magnitude estimates) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Jet@{gp\+Jet}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Jet@{gp\+Jet}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a5f8a9e67b64c17ddfe4f069fe2b9fb02}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a5f8a9e67b64c17ddfe4f069fe2b9fb02}} 
gp\+Jet&Hue variation similar to a spectrum, often used in numerical visualization (creates banding illusion but allows more precise magnitude estimates) \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{gp\+Hues@{gp\+Hues}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!gp\+Hues@{gp\+Hues}}}\mbox{\Hypertarget{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130}\label{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130}} 
gp\+Hues&Full hue cycle, with highest and lowest color red (suitable for periodic data, such as angles and phases, see \mbox{\hyperlink{class_q_c_p_color_gradient_a39d6448155fc00a219f239220d14bb39}{set\+Periodic}}) \\
\hline

\end{DoxyEnumFields}


\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_q_c_p_color_gradient_a546e44df5fa1846400a582c041361c85}\label{class_q_c_p_color_gradient_a546e44df5fa1846400a582c041361c85}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{Q\+C\+P\+Color\+Gradient()}{QCPColorGradient()}}
{\footnotesize\ttfamily Q\+C\+P\+Color\+Gradient\+::\+Q\+C\+P\+Color\+Gradient (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}{Gradient\+Preset}}}]{preset = {\ttfamily \mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557}{gp\+Cold}}} }\end{DoxyParamCaption})}

Constructs a new \mbox{\hyperlink{class_q_c_p_color_gradient}{Q\+C\+P\+Color\+Gradient}} initialized with the colors and color interpolation according to {\itshape preset}.

The color level count is initialized to 350. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_q_c_p_color_gradient_a939213e85f0d1279519d555c5fcfb6ad}\label{class_q_c_p_color_gradient_a939213e85f0d1279519d555c5fcfb6ad}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!clear\+Color\+Stops@{clear\+Color\+Stops}}
\index{clear\+Color\+Stops@{clear\+Color\+Stops}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{clear\+Color\+Stops()}{clearColorStops()}}
{\footnotesize\ttfamily void Q\+C\+P\+Color\+Gradient\+::clear\+Color\+Stops (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Clears all color stops.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_color_gradient_a724e828aa6f0ba5011a9392477c35d3a}{set\+Color\+Stops}}, \mbox{\hyperlink{class_q_c_p_color_gradient_a3b48be5e78079db1bb2a1188a4c3390e}{set\+Color\+Stop\+At}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_color_gradient_aaf423ceb943e177b0ed2c48c811d83dc}\label{class_q_c_p_color_gradient_aaf423ceb943e177b0ed2c48c811d83dc}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!colorize@{colorize}}
\index{colorize@{colorize}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{colorize()}{colorize()}}
{\footnotesize\ttfamily void Q\+C\+P\+Color\+Gradient\+::colorize (\begin{DoxyParamCaption}\item[{const double $\ast$}]{data,  }\item[{const \mbox{\hyperlink{class_q_c_p_range}{Q\+C\+P\+Range}} \&}]{range,  }\item[{Q\+Rgb $\ast$}]{scan\+Line,  }\item[{int}]{n,  }\item[{int}]{data\+Index\+Factor = {\ttfamily 1},  }\item[{bool}]{logarithmic = {\ttfamily false} }\end{DoxyParamCaption})}

This method is used to quickly convert a {\itshape data} array to colors. The colors will be output in the array {\itshape scan\+Line}. Both {\itshape data} and {\itshape scan\+Line} must have the length {\itshape n} when passed to this function. The data range that shall be used for mapping the data value to the gradient is passed in {\itshape range}. {\itshape logarithmic} indicates whether the data values shall be mapped to colors logarithmically.

if {\itshape data} actually contains 2\+D-\/data linearized via {\ttfamily \mbox{[}row$\ast$column\+Count + column\mbox{]}}, you can set {\itshape data\+Index\+Factor} to {\ttfamily column\+Count} to convert a column instead of a row of the data array, in {\itshape scan\+Line}. {\itshape scan\+Line} will remain a regular (1D) array. This works because {\itshape data} is addressed {\ttfamily data\mbox{[}i$\ast$data\+Index\+Factor\mbox{]}}. \mbox{\Hypertarget{class_q_c_p_color_gradient_a9f72f501de429829ec446333316decda}\label{class_q_c_p_color_gradient_a9f72f501de429829ec446333316decda}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!inverted@{inverted}}
\index{inverted@{inverted}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{inverted()}{inverted()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_q_c_p_color_gradient}{Q\+C\+P\+Color\+Gradient}} Q\+C\+P\+Color\+Gradient\+::inverted (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

Returns an inverted gradient. The inverted gradient has all properties as this \mbox{\hyperlink{class_q_c_p_color_gradient}{Q\+C\+P\+Color\+Gradient}}, but the order of the color stops is inverted.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_color_gradient_a724e828aa6f0ba5011a9392477c35d3a}{set\+Color\+Stops}}, \mbox{\hyperlink{class_q_c_p_color_gradient_a3b48be5e78079db1bb2a1188a4c3390e}{set\+Color\+Stop\+At}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_color_gradient_aa0aeec1528241728b9671bf8e60b1622}\label{class_q_c_p_color_gradient_aa0aeec1528241728b9671bf8e60b1622}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!load\+Preset@{load\+Preset}}
\index{load\+Preset@{load\+Preset}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{load\+Preset()}{loadPreset()}}
{\footnotesize\ttfamily void Q\+C\+P\+Color\+Gradient\+::load\+Preset (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072}{Gradient\+Preset}}}]{preset }\end{DoxyParamCaption})}

Clears the current color stops and loads the specified {\itshape preset}. A preset consists of predefined color stops and the corresponding color interpolation method.

The available presets are\+:  \mbox{\Hypertarget{class_q_c_p_color_gradient_aa13fda86406e1d896a465a409ae63b38}\label{class_q_c_p_color_gradient_aa13fda86406e1d896a465a409ae63b38}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!set\+Color\+Interpolation@{set\+Color\+Interpolation}}
\index{set\+Color\+Interpolation@{set\+Color\+Interpolation}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{set\+Color\+Interpolation()}{setColorInterpolation()}}
{\footnotesize\ttfamily void Q\+C\+P\+Color\+Gradient\+::set\+Color\+Interpolation (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_q_c_p_color_gradient_ac5dca17cc24336e6ca176610e7f77fc1}{Q\+C\+P\+Color\+Gradient\+::\+Color\+Interpolation}}}]{interpolation }\end{DoxyParamCaption})}

Sets whether the colors in between the configured color stops (see \mbox{\hyperlink{class_q_c_p_color_gradient_a3b48be5e78079db1bb2a1188a4c3390e}{set\+Color\+Stop\+At}}) shall be interpolated linearly in R\+GB or in H\+SV color space.

For example, a sweep in R\+GB space from red to green will have a muddy brown intermediate color, whereas in H\+SV space the intermediate color is yellow. \mbox{\Hypertarget{class_q_c_p_color_gradient_a3b48be5e78079db1bb2a1188a4c3390e}\label{class_q_c_p_color_gradient_a3b48be5e78079db1bb2a1188a4c3390e}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!set\+Color\+Stop\+At@{set\+Color\+Stop\+At}}
\index{set\+Color\+Stop\+At@{set\+Color\+Stop\+At}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{set\+Color\+Stop\+At()}{setColorStopAt()}}
{\footnotesize\ttfamily void Q\+C\+P\+Color\+Gradient\+::set\+Color\+Stop\+At (\begin{DoxyParamCaption}\item[{double}]{position,  }\item[{const Q\+Color \&}]{color }\end{DoxyParamCaption})}

Sets the {\itshape color} the gradient will have at the specified {\itshape position} (from 0 to 1). In between these color stops, the color is interpolated according to \mbox{\hyperlink{class_q_c_p_color_gradient_aa13fda86406e1d896a465a409ae63b38}{set\+Color\+Interpolation}}.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_color_gradient_a724e828aa6f0ba5011a9392477c35d3a}{set\+Color\+Stops}}, \mbox{\hyperlink{class_q_c_p_color_gradient_a939213e85f0d1279519d555c5fcfb6ad}{clear\+Color\+Stops}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_color_gradient_a724e828aa6f0ba5011a9392477c35d3a}\label{class_q_c_p_color_gradient_a724e828aa6f0ba5011a9392477c35d3a}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!set\+Color\+Stops@{set\+Color\+Stops}}
\index{set\+Color\+Stops@{set\+Color\+Stops}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{set\+Color\+Stops()}{setColorStops()}}
{\footnotesize\ttfamily void Q\+C\+P\+Color\+Gradient\+::set\+Color\+Stops (\begin{DoxyParamCaption}\item[{const Q\+Map$<$ double, Q\+Color $>$ \&}]{color\+Stops }\end{DoxyParamCaption})}

Sets at which positions from 0 to 1 which color shall occur. The positions are the keys, the colors are the values of the passed Q\+Map {\itshape color\+Stops}. In between these color stops, the color is interpolated according to \mbox{\hyperlink{class_q_c_p_color_gradient_aa13fda86406e1d896a465a409ae63b38}{set\+Color\+Interpolation}}.

A more convenient way to create a custom gradient may be to clear all color stops with \mbox{\hyperlink{class_q_c_p_color_gradient_a939213e85f0d1279519d555c5fcfb6ad}{clear\+Color\+Stops}} and then adding them one by one with \mbox{\hyperlink{class_q_c_p_color_gradient_a3b48be5e78079db1bb2a1188a4c3390e}{set\+Color\+Stop\+At}}.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_color_gradient_a939213e85f0d1279519d555c5fcfb6ad}{clear\+Color\+Stops}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_color_gradient_a18da587eb4f7fc788ea28ba15b6a12de}\label{class_q_c_p_color_gradient_a18da587eb4f7fc788ea28ba15b6a12de}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!set\+Level\+Count@{set\+Level\+Count}}
\index{set\+Level\+Count@{set\+Level\+Count}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{set\+Level\+Count()}{setLevelCount()}}
{\footnotesize\ttfamily void Q\+C\+P\+Color\+Gradient\+::set\+Level\+Count (\begin{DoxyParamCaption}\item[{int}]{n }\end{DoxyParamCaption})}

Sets the number of discretization levels of the color gradient to {\itshape n}. The default is 350 which is typically enough to create a smooth appearance.

 \mbox{\Hypertarget{class_q_c_p_color_gradient_a39d6448155fc00a219f239220d14bb39}\label{class_q_c_p_color_gradient_a39d6448155fc00a219f239220d14bb39}} 
\index{Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}!set\+Periodic@{set\+Periodic}}
\index{set\+Periodic@{set\+Periodic}!Q\+C\+P\+Color\+Gradient@{Q\+C\+P\+Color\+Gradient}}
\subsubsection{\texorpdfstring{set\+Periodic()}{setPeriodic()}}
{\footnotesize\ttfamily void Q\+C\+P\+Color\+Gradient\+::set\+Periodic (\begin{DoxyParamCaption}\item[{bool}]{enabled }\end{DoxyParamCaption})}

Sets whether data points that are outside the configured data range (e.\+g. \mbox{\hyperlink{class_q_c_p_color_map_a980b42837821159786a85b4b7dcb8774}{Q\+C\+P\+Color\+Map\+::set\+Data\+Range}}) are colored by periodically repeating the color gradient or whether they all have the same color, corresponding to the respective gradient boundary color.



As shown in the image above, gradients that have the same start and end color are especially suitable for a periodic gradient mapping, since they produce smooth color transitions throughout the color map. A preset that has this property is \mbox{\hyperlink{class_q_c_p_color_gradient_aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130}{gp\+Hues}}.

In practice, using periodic color gradients makes sense when the data corresponds to a periodic dimension, such as an angle or a phase. If this is not the case, the color encoding might become ambiguous, because multiple different data values are shown as the same color. 

The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
R\+:/\+Develop/a0-\/develop/\+Lib\+Q\+Qt/src/charts/qcustomplot/\mbox{\hyperlink{qcustomplot_8h}{qcustomplot.\+h}}\item 
R\+:/\+Develop/a0-\/develop/\+Lib\+Q\+Qt/src/charts/qcustomplot/\mbox{\hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}}\end{DoxyCompactItemize}
